<template>
	<view class="container">
		<view class="qrcode">
			<image mode="widthFix" :src=" qrcode " @tap="previewImage"></image>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				qrcode: '',
			}
		},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow: function() {
			// 获取推广二维码		
			uni.showModal({
				title: '提示',
				content: '抱歉，该功能开发中！',
				success: function(res) {
					uni.switchTab({
						url: '/pages/index/index',
					})
				}
			});
			return false;
			this.getPoster();
		},
		methods: {
			/**
			 * 获取推广二维码
			 */
			getPoster: function() {
				let _this = this;

				_this._get('user.dealer.Qrcode/poster', {}, function(result) {

					// 设置当前页面标题
					// uni.setNavigationBarTitle({
					// 	title: result.data.words.qrcode.title.value
					// })
					// console.log(result);return false;

					// _this.setData(result.data);
				}, null, function() {

					uni.hideLoading();
				});
			},

			previewImage: function() {
				uni.previewImage({
					current: this.qrcode,
					urls: [this.qrcode]
				})
			},
		}
	}
</script>

<style>
	page {
		background: #fff;
	}

	.qrcode image {
		display: block;
		width: 100%;
	}
</style>
